package o;

import android.content.Context;
import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseCardBean;
import java.lang.ref.WeakReference;
import o.dws.d;
import o.ewm.n;

public class dxa implements d {
    private String ˊ;
    private BaseCardBean ˎ;
    private Context ˏ;
    private String ॱ;

    static class a implements cks {
        private String ˊ;
        private WeakReference<Context> ˋ;
        private String ˎ;
        private String ॱ;

        a(Context context, String str, String str2, String str3) {
            this.ˋ = new WeakReference(context);
            this.ˎ = str;
            this.ˊ = str2;
            this.ॱ = str3;
        }

        public void enableNetworking() {
            if (this.ˋ == null) {
                Logger.ˋ("GameAssistantDeeplinkListener", "contextWeakReference  == null");
                return;
            }
            Context context = (Context) this.ˋ.get();
            if (context == null) {
                Logger.ˋ("GameAssistantDeeplinkListener", "context == null");
                return;
            }
            dwv.ˊ(context, "gameAssistantDialog");
            dwv.ॱ(context, this.ˎ, this.ˊ, this.ॱ);
        }

        public void upgrade() {
            if (this.ˋ == null) {
                Logger.ˋ("GameAssistantDeeplinkListener", "contextWeakReference  == null");
                return;
            }
            Context context = (Context) this.ˋ.get();
            if (context == null) {
                Logger.ˋ("GameAssistantDeeplinkListener", "context == null");
            } else {
                dwv.ˊ(context, "gameAssistantDialog");
            }
        }

        public void ˋ() {
        }
    }

    public void ˎ(Context context, BaseCardBean baseCardBean, String str, String str2) {
        this.ˏ = context;
        this.ˎ = baseCardBean;
        this.ˊ = str;
        this.ॱ = str2;
        if (!erz.ˏ(context, "com.huawei.gameassistant")) {
            ˎ(context, baseCardBean.י(), baseCardBean.u_(), str);
        } else if (dwv.ˊ(str)) {
            new dws(context, str, baseCardBean.ॱॱ(), this).ˏ(context);
        } else {
            ॱ(context, baseCardBean, str, str2);
        }
    }

    private void ॱ(Context context, BaseCardBean baseCardBean, String str, String str2) {
        int ˋ = dwv.ˋ(context, baseCardBean.ॱॱ(), str, str2);
        if (ˋ != -2) {
            if (ˋ == -1) {
                ˎ(context, baseCardBean.י(), baseCardBean.u_(), str);
            }
            dwv.ˏ(context, baseCardBean.ॱॱ(), str, str2, ˋ);
        }
    }

    private void ˎ(Context context, String str, String str2, String str3) {
        cku ˏ = cku.ˏ(context, cku.class, null, context.getString(n.ʽʻ));
        ˏ.ॱ(-1, context.getString(n.ˆ));
        ˏ.ॱ(new a(context, str3, str, str2));
        ˏ.ˋ(context, "gameAssistantDialog");
    }

    public void aj_() {
        ॱ(this.ˏ, this.ˎ, this.ˊ, this.ॱ);
    }

    public void ak_() {
    }
}
